<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
	<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Insert title here</title>
    <style> 
div
{
border:2px solid #a1a1a1;
padding:10px 40px; 
background:#dddddd;
width:300px;
border-radius:25px;
margin: auto;

}
</style>
</head>
<sql:query dataSource="jdbc/myoracle" var="result">SELECT amtdue FROM CustomerDetails WHERE user_name = '${pageContext.request.getUserPrincipal().getName()}'</sql:query>

<body>
<div align="center">
    <c:forEach var="row" items="${result.rows}">
        <html:form action="/customer_pay">
            <table>
                <tr>
                    <td>Amount Due: </td>
                    <c:set var="amtdue" scope="page" value="${row.amtdue}" />
                    <td>
                        <c:out value="${row.amtdue}" />
                    </td>
                </tr>
                <tr>

                    <td>
                        <input name="pay_amount" />
                    </td>
                    <td>
                        <input type="submit" value="submit" name="submit" />
                    </td>
                </tr>
            </table>
        </html:form>

        <%--<c:if test='${param.submit.equals("submit")}'>
            <sql:update dataSource="jdbc/myoracle" var="result">
                UPDATE CustomerDetails SET amtdue=${amtdue - param.pay_amount} WHERE user_name='${pageContext.request.getUserPrincipal().getName()}'
            </sql:update>
            <jsp:forward page="Home.jsp">
                <jsp:param name="nn" value="1" />
            </jsp:forward>
        </c:if>--%>

    </c:forEach>
</div>
</body>

</html>